package com.cedric.yixianpai.game.cards.Sects.swordCards.e_HuaShen;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class LianHuanJianZhen extends SwordCard {
    /**
     * title:连环剑阵
     * effect:防+1/5/10 重复上1张剑阵的效果
     */
    public LianHuanJianZhen(@Value("1") int lvl) {
        super("连环剑阵");
        this.setLevel(lvl);
        this.setCardType(CardType.ZHEN);
        this.setPeriod(Period.HUASHEN);
        this.setDescription("防+1/5/10 重复上1张剑阵的效果");

        if (1 == lvl) {
            this.setShield(1);
        } else if (2 == lvl) {
            this.setShield(5);
        } else if (3 == lvl) {
            this.setShield(10);
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addShield(this.getShield());
        Sta1.getPlayerBuff().setLHJZ();
        return true;
    }
}
